package com.powernode.spring6.annotation;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component("userBean")
public class User {
//    @Value(value = "张三")
    private String name;

    @Value("14")
    private Integer age;

    public User() {
    }

    public User(String name, @Value("58") Integer age) {
        this.name = name;
        this.age = age;
    }

//    @Value("李四")
//    public void setName(String name) {
//        this.name = name;
//    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
